<div class="contentArea">
    <div class="Item hr">
        <div class="current">编辑栏目</div>
    </div>
    <form>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table1">
            <if condition="$existSubCategory eq true ">

                <else/>
                <tr>
                    <th width="80">栏目父类型：</th>
                    <td>
                        <select name="category[pid]" id="pid">
                            <option value="" >请选择...</option>
                            <volist name="parents" id="parent">
                                <option value="{$parent['id']}" relation_model="{$parent['relation_model']}">{$parent['name']}</option>
                            </volist>
                        </select>
                    </td>
                </tr>
            </if>
            <tr>
                <th width="80">关联模型：</th>
                <td>
                    <if condition="$existSubCategory eq true ">
                        <input name="category[relation_model]" type="hidden" class="input" size="30" value="{$category['relation_model']}" readonly="readonly"/>
                    <else/>
                    <select name="category[relation_model]" id="relation_model"  disabled="disabled" >
                        <option value="" >请选择...</option>
                        <option value="Article">文章</option>
                        <option value="Product">产品</option>
                    </select>
                    </if>
                </td>
            </tr>

            <tr>
                <th width="80">栏目名称：</th>
                <td><input name="category[name]" type="text" class="input" size="30" value="{$category['name']}" /></td>
            </tr>
            <tr>
                <th width="80">导航显示：</th>
                <td>显示<input type="radio" name="category[is_show]" value="1" <if condition="$category['is_show'] eq 1">checked="checked"</if>/> &nbsp;&nbsp;&nbsp;&nbsp;
                    不显示<input type="radio" name="category[is_show]" value="2" <if condition="$category['is_show'] eq 2">checked="checked"</if>/> </td>
            </tr>
            <tr>
                <th width="90">页面展示类型：</th>
                <td>单页面<input type="radio" name="category[page_type]" value="1" <if condition="$category['page_type'] eq 1">checked="checked"</if>/> &nbsp;&nbsp;&nbsp;&nbsp;
                    列表页面<input type="radio" name="category[page_type]" value="2" <if condition="$category['page_type'] eq 2">checked="checked"</if>/>
                    &nbsp;&nbsp;<span id="page_size" style="display: none;">每页显示<input type="text" name="category[page_size]" class="input" size="1" value="{$category['page_size']}"/>篇文章</span>
                    &nbsp;&nbsp;<span id="target_detail_tpl" style="display: none;">详细页面模版名称<input type="text" name="category[target_detail_tpl]" class="input" size="5" value="{$category['target_detail_tpl']}"/></span>
                </td>
            </tr>
            <tr>
                <th width="90">页面模版名称：</th>
                <td>
                    <input name="category[target_tpl]" type="text" class="input" size="30" value="{$category['target_tpl']}"/>
                </td>
            </tr>
            <tr>
                <th width="80">栏目排序：</th>
                <td>
                    <input name="category[sort]" type="text" class="input" size="5" value="{$category['sort']}" />
                </td>
            </tr>
            <input type="hidden" name="category[id]" value="{$category['id']}" />
        </table>
    </form>
    <div class="commonBtnArea" >
        <button class="btn submit">提交</button>
        <button class="btn goBack">返回</button>
    </div>
</div>
<include file="Category:javascript" />
<script type="text/javascript">
$(function(){
    $(".submit").click(function(){
        commonAjaxSubmit("{:U('Category/update')}");
        return false;
    });
    $("select[name='category[pid]']").val("{$category['pid']}");
    $("select[name='category[relation_model]']").val("{$category['relation_model']}");
    var page_type = "{$category['page_type']}";
    if(page_type==2){
        $("#page_size").show();
    }
});
</script>
